<include file="Common/header" />
<!-- 顶部 -->     
<div id="middle">
    <include file="Common/menu" />
    <div class="right" id="mainFrame">
		<div class="right_cont">
			<ul class="breadcrumb">当前位置：
				<a href="javascript:void(0);">首页</a> <span class="divider">/</span>
				<a href="javascript:void(0);">自助制卡</a> <span class="divider">/</span>
				支付日志
			</ul>
			<div class="title_right"><strong>按条件查询</strong></div>
			<form action="" method="POST" id="addfrom">
				<div>
					<table class="table table-bordered">
						<tr>
							<td width="20%" align="right" bgcolor="#f1f1f1">开始时间：</td>
							<td>
								<input type="text" name="btime" id="btime" class="laydate-icon span1-3" value="" />
								<span class="nicknameabel"></span>
							</td>
							<td width="20%" align="right" bgcolor="#f1f1f1">结束时间：</td>
							<td>
								<input type="text" name="etime" id="etime" class="laydate-icon span1-3" value="" />
								<span class="nicknameabel"></span>
							</td>
						</tr>
						
					</table>
					
					<table  class="margin-bottom-20 table  no-border" >
						<tr>
							<td class="text-center">
								<input type="button" value="查询" class="btn btn-info roleSubmit" style="width:80px;" />
								<input type="button" value="导出Excel" class="btn btn-danger" style="width:80px; display:none;" />
							</td>
						</tr>
					</table>
				</div>
			</form>
			<div class="title_right"><strong>记录列表</strong></div>
			<div id="ajaxDiv" style="height:auto; overflow:scroll;">
				<include file="Paylog/query_list_2" />
			</div>
		</div>     
    </div>
</div>
<script>
	$(document).ready(function(){
		$(".roleSubmit").on('click', function(){
			var where = {};
				//where.room_number = $("#room_number").val();
				where.btime = $("#btime").val();
				where.etime = $("#etime").val();
				where.ajax = 1;
			if(where.btime == "" && where.etime != ""){
				alert("请选择开始时间");
				return false;
			}
			
			$.get('paylog/index.html', where, function(data){
				$("#ajaxDiv").html(data);
			});
		});
		
		$(".btn-danger").on('click', function(){
			var where = {};
				where.room_number = $("#room_number").val();
				where.begin_time = $("#btime").val();
				where.end_time = $("#etime").val();
				where.ajax = 1;
			if(where.begin_time == "" && where.end_time != ""){
				alert("请选择开始时间");
				return false;
			}
			
			var url = "openexcel.html?room_number=" + where.room_number + "&begin_time="+ where.begin_time + '&end_time=' +where.end_time;
			location.href = url;
		});
		
	});
</script>
<script>
!function(){
	laydate.skin('molv');
	laydate({elem: '#btime'});
	laydate({elem: '#etime'});
}();
</script>
<include file="Common/footer" />
